package view;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Image;

import javax.swing.JPanel;

import data.Images;

public class EditControlButton extends JPanel{
	String btnText;
	Images images;
	Image btnImage;
	public EditControlButton(String _btnText){
		images = new Images();
		btnImage = images.getImage("EditControlLabel");
		btnText = _btnText;
		Dimension btnSize = new Dimension(105,25);
		this.setSize(btnSize);
		this.setPreferredSize(btnSize);
		this.setMinimumSize(btnSize);
		this.setOpaque(false);
	}
	public void paint(Graphics g){
		Font font = new Font("Arial", Font.BOLD, 12);
		g.setColor(Color.red);
		g.setFont(font);
		if(btnText.equals("Defaults") || btnText.equals("Load") || btnText.equals("Save")){
			g.setColor(Color.orange);
		}
		g.drawImage(btnImage, 0, 0, btnImage.getWidth(this), btnImage.getHeight(this), this);
		
		g.drawString(btnText, 10, 14);
	}
}
